<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <cpn :pnum="num" @send-change="receiveChange"></cpn>
</div>
<template id="cpn">
  <div>
    <h2>pnum:{{pnum}}</h2>
    <h2>dnum:{{dnum}}</h2>
    <input type="text" :value="dnum" @input="inputEvent">
  </div>
</template>
<script src="../js/vue.js"></script>
<script>
  const aaa = new Vue({
    el: "#app",
    data: {
      num: 8888,
    },
    methods: {
      receiveChange(item) {
        this.num = item;
      }
    },
    components: {
      cpn: {
        template: '#cpn',
        data() {
          return {
            dnum: this.pnum
          }
        },
        props: {
          pnum: Number
        },
        methods: {
          inputEvent(event) {
            this.dnum = parseInt(event.target.value);
            this.$emit('send-change', this.dnum);
          }
        }
      }
    }
  })
</script>
</body>
</html>